cmake_minimum_required(VERSION 2.8.12.2)
project(save_my_ass)

set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 1)
set(PROJECT_VERSION "\"v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}\"")
set(PROJ_SRC_DIR "${PROJECT_SOURCE_DIR}/src")
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/bin")


if(WIN32)
    set(SYSTEM_CMD_CLEAR "\"cls\"")
elseif(UNIX)
    set(SYSTEM_CMD_CLEAR "\"clear\"")
else()
    message(SEND_ERROR "Current operation system platform not supported yet!")
endif()


configure_file(
    "${PROJECT_SOURCE_DIR}/config.h.in"
    "${PROJECT_BINARY_DIR}/config.h"
)

set(HEADERS
    ${PROJECT_BINARY_DIR}/config.h
    ${PROJ_SRC_DIR}/Student.h
    ${PROJ_SRC_DIR}/Manager.h
    )

set(SOURCES
    ${PROJ_SRC_DIR}/Student.cpp
    ${PROJ_SRC_DIR}/Manager.cpp
    ${PROJ_SRC_DIR}/main.cpp
    )

include_directories("${PROJECT_BINARY_DIR}")
include_directories("${PROJ_SRC_DIR}")

if(NOT MSVC)
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -Wall -g -ggdb")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -Wall")
endif()

add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES})
